﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace MyMusicPlay._4._0
{
    public static class FrameworkElementExtend
    {
        public static List<T> GetElement<T>(this Panel panel) where T : FrameworkElement
        {
            List<T> list = new List<T>();
            foreach (var item in panel.Children)
            {
                var curElement = item as T;
                if (curElement is not null)
                {
                    list.Add(curElement);
                }
            }
            return list;
        }
    }
}
